﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using org.xisoft.game.utils.game;

namespace org.xisoft.game.GobangModule.Chess.Algorithms
{
    class DeepSearchAlgorithm : AiAlgorithm
    {
        public override MoveAction DoNextMove(GobangBroad gobangBroad, int depth)
        {
            List<MoveAction> points = GetAllCanMoves(gobangBroad);
            MoveAction bestMove = null;
            foreach (MoveAction move in points)
            {
                long score = GetScore(gobangBroad as GobangBroad,move.ToX, move.ToY);
                if (bestMove == null || bestMove.Score < score)
                    bestMove = move;
                
            }

            return bestMove;
        }
    }
}
